
import React from "react";
import {Link} from "react-router";
import cookie from "react-cookie";

class paySuccess extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            shopNo: 0,
            shopName: "",
            amount: ''
        }
    }

    componentWillMount() {
        document.title = "叮叮收钱";
    }

    componentDidMount() {
        const query = this.props.location.query;
        if(query.amount) {
            this.setState({
                amount: query.amount,
                shopNo: query.shopNo,
                shopName: query.shopName
            })
        }
    }

    render() {
        return (
            <div>
                <div className="pay-success-title">
                    <img src="http://oeb6w1s1c.bkt.clouddn.com/pay_success_01.png"/>
                    <div>支付成功</div>
                </div>
                <div>
                    <div className="pay-success-shop">{this.state.shopName}</div>
                    <div className="pay-success-amount">¥{this.state.amount}</div>
                </div>

                <div className="pay-success-back">
                    <Link to="pay/merchantPay" query={{shopNo:this.state.shopNo, shopName:this.state.shopName, amount:this.state.amount}}>
                       <img src="http://oeb6w1s1c.bkt.clouddn.com/back_shop.png"/>
                    </Link>
                </div>
            </div>
        )
    }
}

export default paySuccess;